#ifndef SM3_H
#define SM3_H
#include<stdint.h>
#include"sha256.h"
#define ROTL(x,n) ((x<<n)|(x>>(32-n)))
#define T(j) j<16?(uint32_t)0x79cc4519:(uint32_t)7a879d8a;
#define FF(j,x,y,z) (j<16?x^y^z:MAJ(x,y,z))
#define GG(j,x,y,z) (j<16?x^y^z:(x&y)|(~x&z))
#define P0(x) (x^ROTL(x,9)^ROTL(x,17))
#define P1(x) (x^ROTL(x,15)^ROTL(x,23))
extern uint32_t IV[];
void calc_sm3(uint32_t* in,int blocknum,uint32_t* out);
#endif